<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="Hexo Theme Redefine">
    
    <meta name="author" content="雲之残骸">
    <!-- preconnect -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    
    
    <!--- Seo Part-->
    
    <link rel="canonical" href="https://wreckloud.github.io/2023/09/24/excel技巧记录/"/>
    <meta name="robots" content="index,follow">
    <meta name="googlebot" content="index,follow">
    <meta name="revisit-after" content="1 days">
    
        <meta name="description" content="起因是统计同学们交来的文件夹,有没有交齐...">
<meta property="og:type" content="article">
<meta property="og:title" content="EXCEL技巧记录">
<meta property="og:url" content="https://wreckloud.github.io/2023/09/24/EXCEL%E6%8A%80%E5%B7%A7%E8%AE%B0%E5%BD%95/index.html">
<meta property="og:site_name" content="赛博狼窝">
<meta property="og:description" content="起因是统计同学们交来的文件夹,有没有交齐...">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-09-24T02:38:32.000Z">
<meta property="article:modified_time" content="2023-09-25T07:52:10.344Z">
<meta property="article:author" content="Wreckloud">
<meta property="article:tag" content="经验记录">
<meta name="twitter:card" content="summary">
    
    
    <!--- Icon Part-->
    <link rel="icon" type="image/png" href="/images/web.png" sizes="192x192">
    <link rel="apple-touch-icon" sizes="180x180" href="/images/web.png">
    <meta name="theme-color" content="#A31F34">
    <link rel="shortcut icon" href="/images/web.png">
    <!--- Page Info-->
    
    <title>
        
            EXCEL技巧记录 -
        
        赛博狼窝
    </title>
    
<link rel="stylesheet" href="/css/style.css">


    
        
<link rel="stylesheet" href="/css/build/styles.css">

    

    
<link rel="stylesheet" href="/fonts/fonts.css">

    
<link rel="stylesheet" href="/fonts/Satoshi/satoshi.css">

    
<link rel="stylesheet" href="/fonts/Chillax/chillax.css">

    <!--- Font Part-->
    
    
        <link href="" rel="stylesheet">
    
    
    

    <!--- Inject Part-->
    
    <script id="hexo-configurations">
    let Global = window.Global || {};
    Global.hexo_config = {"hostname":"wreckloud.github.io","root":"/","language":"zh-CN","path":"search.xml"};
    Global.theme_config = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"4px","image_alignment":"center","image_caption":true,"link_icon":true},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":false,"style":"simple","font":{"enable":"ture","family":null,"url":null}},"toc":{"enable":true,"max_depth":3,"number":false,"expand":true,"init_open":true},"copyright":false,"lazyload":true,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"mobile_limit":2,"placeholder":"/images/wallhaven-wqery6-light.webp","skip_dirs":[]}},"colors":{"primary":"#A31F34","secondary":null},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":false,"percentage":true},"website_counter":{"url":"https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js","enable":false,"site_pv":true,"site_uv":true,"post_pv":true},"single_page":true,"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"fixed","image":{"light":"/images/wallhaven-wqery6-light.webp","dark":"/images/wallhaven-wqery6-dark.webp"},"title":"今天也要好心情!","subtitle":{"text":["正在加载..."],"hitokoto":{"enable":"ture","api":"https://v1.hitokoto.cn"},"typing_speed":130,"backing_speed":80,"starting_delay":1500,"backing_delay":3000,"loop":false,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":false,"links":{"github":null,"instagram":null,"zhihu":null,"twitter":null,"bilibili":null},"qrs":{"weixin":null}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null}]},"mermaid":{"enable":true,"version":"9.3.0"}},"version":"2.4.4","navbar":{"auto_hide":false,"color":{"left":"#f78736","right":"#367df7","transparency":35},"links":{"Home":{"path":"/","icon":"fa-solid fa-house"},"tags":{"path":"/tag/","icon":"fa-solid fa-tags"},"Status":{"path":"/masonry/","icon":"fa-solid fa-sparkles"},"About":{"icon":"fa-solid fa-feather","submenus":{"关于我":"/about/","我的b站":"https://space.bilibili.com/177822535?spm_id_from=333.1007.0.0"}}},"search":{"enable":true,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"info","announcement":"欢迎朋友们参观!  不过刚刚搭好现在还没什么内容呢...","links":null},"article_date_format":"auto","categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}},"footerStart":"2023/9/17 14:00:00"};
    Global.language_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
    Global.data_config = {"masonry":true};
  </script>
    
    <!--- Fontawesome Part-->
    
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">

    
<link rel="stylesheet" href="/fontawesome/brands.min.css">

    
<link rel="stylesheet" href="/fontawesome/solid.min.css">

    
<link rel="stylesheet" href="/fontawesome/regular.min.css">

    
    
    
    
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
<div class="progress-bar-container">
    

    
        <span class="pjax-progress-bar"></span>
        <span class="swup-progress-icon">
            <i class="fa-solid fa-circle-notch fa-spin"></i>
        </span>
    
</div>


<main class="page-container" id="swup">

    

    <div class="main-content-container">


        <div class="main-content-header">
            <header class="navbar-container">
    
    <div class="navbar-content">
        <div class="left">
            
            <a class="logo-title" href="https://wreckloud.github.io/">
                
                赛博狼窝
                
            </a>
        </div>

        <div class="right">
            <!-- PC -->
            <div class="desktop">
                <ul class="navbar-list">
                    
                        
                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/"  >
                                    
                                        
                                            <i class="fa-solid fa-house"></i>
                                        
                                        首页
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/tag/"  >
                                    
                                        
                                            <i class="fa-solid fa-tags"></i>
                                        
                                        标签
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/masonry/"  >
                                    
                                        
                                            <i class="fa-solid fa-sparkles"></i>
                                        
                                        画廊
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                        
                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="has-dropdown" 
                                    href="#" onClick="return false;">
                                    
                                        
                                            <i class="fa-solid fa-feather"></i>
                                        
                                        关于&nbsp;<i class="fa-solid fa-chevron-down"></i>
                                    
                                </a>
                                <!-- Submenu -->
                                
                                    <ul class="sub-menu">
                                    
                                        <li>
                                        <a href="/about/">关于我
                                        </a>
                                        </li>
                                    
                                        <li>
                                        <a target="_blank" rel="noopener" href="https://space.bilibili.com/177822535?spm_id_from=333.1007.0.0">我的B站
                                        </a>
                                        </li>
                                    
                                    </ul>
                                
                            </li>
                    
                    
                        <li class="navbar-item search search-popup-trigger">
                            <i class="fa-solid fa-magnifying-glass"></i>
                        </li>
                    
                </ul>
            </div>
            <!-- Mobile -->
            <div class="mobile">
                
                    <div class="icon-item search search-popup-trigger"><i class="fa-solid fa-magnifying-glass"></i></div>
                
                <div class="icon-item navbar-bar">
                    <div class="navbar-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- Mobile drawer -->
    <div class="navbar-drawer w-full absolute top-0 left-0 bg-background-color">
        <ul class="drawer-navbar-list flex flex-col justify-start items-center">
            
                
                    <li class="drawer-navbar-item text-base my-1.5 flex justify-center items-center">
                        <a class="rounded-3xl py-1.5 px-5 hover:border hover:!text-primary active:!text-primary group " 
                        href="/"  >
                             
                                
                                    <i class="fa-solid fa-house"></i>
                                
                                首页
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            
                
                    <li class="drawer-navbar-item text-base my-1.5 flex justify-center items-center">
                        <a class="rounded-3xl py-1.5 px-5 hover:border hover:!text-primary active:!text-primary group " 
                        href="/tag/"  >
                             
                                
                                    <i class="fa-solid fa-tags"></i>
                                
                                标签
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            
                
                    <li class="drawer-navbar-item text-base my-1.5 flex justify-center items-center">
                        <a class="rounded-3xl py-1.5 px-5 hover:border hover:!text-primary active:!text-primary group " 
                        href="/masonry/"  >
                             
                                
                                    <i class="fa-solid fa-sparkles"></i>
                                
                                画廊
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            
                
                    <li class="drawer-navbar-item text-base my-1.5 flex justify-center items-center">
                        <a class="rounded-3xl py-1.5 px-5 hover:border hover:!text-primary active:!text-primary group has-dropdown" 
                        href="#" onClick="return false;">
                            
                                
                                    <i class="fa-solid fa-feather"></i>
                                
                                关于&nbsp;<i class="group-hover:rotate-180 transition-transform fa-solid fa-chevron-down"></i>
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                              
                        
                            <li class="text-base flex justify-center items-center hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                <a class="py-0.5" href="/about/">关于我</a>
                            </li>
                        
                            <li class="text-base flex justify-center items-center hover:underline active:underline hover:underline-offset-1 rounded-3xl">
                                <a class="py-0.5" target="_blank" rel="noopener" href="https://space.bilibili.com/177822535?spm_id_from=333.1007.0.0">我的B站</a>
                            </li>
                        
                    
            

        </ul>
    </div>

    <div class="window-mask"></div>

</header>


        </div>

        <div class="main-content-body">

            

            <div class="main-content">

                
                    <div class="post-page-container">
    <div class="article-content-container">

        <div class="article-title">
            
                
                
                <img src="/../img/EXCEL%E6%8A%80%E5%B7%A7.jpg" alt="EXCEL技巧记录" class="max-w-none"/>
                
                <h1 class="article-title-cover">EXCEL技巧记录</h1>
            
            </div>
            
                    
        
        
            <div class="article-header">
                <div class="avatar">
                    <img src="/images/default.png">
                </div>
                <div class="info">
                    <div class="author">
                        <span class="name">雲之残骸</span>
                        
                            <span class="author-label">Lv1</span>
                        
                    </div>
                    <div class="meta-info">
                        <div class="article-meta-info">
    <span class="article-date article-meta-item">
        <i class="fa-regular fa-pen-fancy"></i>&nbsp;
        <span class="desktop">2023-09-24 10:38:32</span>
        <span class="mobile">2023-09-24 10:38:32</span>
        <span class="hover-info">创建</span>
    </span>
    
        <span class="article-date article-meta-item">
            <i class="fa-regular fa-wrench"></i>&nbsp;
            <span class="desktop">2023-09-25 15:52:10</span>
            <span class="mobile">2023-09-25 15:52:10</span>
            <span class="hover-info">更新</span>
        </span>
    

    
    
        <span class="article-tags article-meta-item">
            <i class="fa-regular fa-tags"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/tags/%E7%BB%8F%E9%AA%8C%E8%AE%B0%E5%BD%95/">经验记录</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    

    
    
        <span class="article-wordcount article-meta-item">
            <i class="fa-regular fa-typewriter"></i>&nbsp;<span>899 字</span>
        </span>
    
    
        <span class="article-min2read article-meta-item">
            <i class="fa-regular fa-clock"></i>&nbsp;<span>4 分钟</span>
        </span>
    
    
</div>

                    </div>
                </div>
            </div>
        

        


        <div class="article-content markdown-body">
            <h1 id="excel数据处理技巧："><a href="#excel数据处理技巧：" class="headerlink" title="excel数据处理技巧："></a>excel数据处理技巧：</h1><h2 id="提取文件名的方法"><a href="#提取文件名的方法" class="headerlink" title="提取文件名的方法"></a>提取文件名的方法</h2><ol>
<li><p>复制文件夹地址。</p>
</li>
<li><p>点击【公式】栏中的【名称管理器】按钮（或按Ctrl+F3），在弹出的对话框中，点击【新建】。</p>
</li>
<li><p>任意命名名称，如“提取文件名”，将引用位置修改为”&#x3D;files(“文件夹地址*.*”)”，其中第一个星号表示所有文件名称，第二个星号表示所有文件类型。如果我们仅想提取其中的Excel文件，可以将第二个星号改为“xls”或“xlsx”。</p>
</li>
<li><p>使用INDEX+ROW的组合函数从定义名称中提取每一个文件名，具体公式为：</p>
</li>
</ol>
<blockquote>
<p>&#x3D;INDEX(定义名称,ROW())</p>
</blockquote>
<p><a class="link"   target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/136005910" >原文 <i class="fa-regular fa-arrow-up-right-from-square fa-sm"></i></a></p>
<p>好的，我可以用一个代码块回复你完整的代码内容。请看下面的代码：</p>
<div class="highlight-container" data-rel="C"><figure class="iseeu highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;stdio.h&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> MAXSIZE 30</span></span><br><span class="line"><span class="keyword">typedef</span> <span class="type">int</span> datatype;</span><br><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">struct</span> &#123;</span></span><br><span class="line">    datatype data[MAXSIZE];</span><br><span class="line">    <span class="type">int</span> last;</span><br><span class="line">&#125;SeqList;</span><br><span class="line"><span class="type">void</span> <span class="title function_">merge</span><span class="params">(SeqList A,SeqList B,SeqList *C)</span>;</span><br><span class="line"><span class="type">void</span> <span class="title function_">intersection</span><span class="params">(SeqList A,SeqList B,SeqList *C)</span>;</span><br><span class="line"><span class="type">void</span> <span class="title function_">difference</span><span class="params">(SeqList A,SeqList B,SeqList *C)</span>;</span><br><span class="line"><span class="type">void</span> <span class="title function_">output</span><span class="params">(SeqList C)</span>;</span><br><span class="line"></span><br><span class="line"><span class="type">void</span> <span class="title function_">main</span><span class="params">()</span></span><br><span class="line">&#123; </span><br><span class="line">  SeqList A=&#123;&#123;<span class="number">20</span>,<span class="number">30</span>,<span class="number">40</span>,<span class="number">50</span>,<span class="number">60</span>,<span class="number">70</span>,<span class="number">80</span>,<span class="number">90</span>,<span class="number">100</span>&#125;,<span class="number">8</span>&#125;;</span><br><span class="line">  SeqList B=&#123;&#123;<span class="number">15</span>,<span class="number">20</span>,<span class="number">25</span>,<span class="number">35</span>,<span class="number">40</span>,<span class="number">55</span>,<span class="number">60</span>,<span class="number">75</span>,<span class="number">85</span>,<span class="number">95</span>&#125;,<span class="number">9</span>&#125;;</span><br><span class="line">  SeqList C;</span><br><span class="line">  <span class="comment">/*计算集合的并*/</span></span><br><span class="line"></span><br><span class="line"> <span class="built_in">printf</span>(“A和B的并集为：\n”);</span><br><span class="line"> merge(A,B,&amp;C);</span><br><span class="line"> output(C);</span><br><span class="line">  <span class="comment">/*计算集合的交*/</span> </span><br><span class="line"> </span><br><span class="line"><span class="built_in">printf</span>(“A和B的交集为：\n”);</span><br><span class="line"> intersection(A,B,&amp;C);</span><br><span class="line"> output(C);</span><br><span class="line">  <span class="comment">/*计算集合的差*/</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">printf</span>(“A和B的差集为：\n”);</span><br><span class="line"> difference(A,B,&amp;C);</span><br><span class="line"> output(C);</span><br><span class="line">&#125;</span><br><span class="line"><span class="type">void</span> <span class="title function_">output</span><span class="params">(SeqList C)</span></span><br><span class="line">&#123; <span class="type">int</span> i;</span><br><span class="line"><span class="keyword">for</span>(i=<span class="number">0</span>;i&lt;=C.last;i++)</span><br><span class="line">     &#123; <span class="built_in">printf</span>(<span class="string">&quot;%-6d&quot;</span>,C.data[i]);</span><br><span class="line">      <span class="keyword">if</span>((i+<span class="number">1</span>)%<span class="number">5</span>==<span class="number">0</span>) <span class="built_in">printf</span>(<span class="string">&quot;\n&quot;</span>);</span><br><span class="line">&#125;</span><br><span class="line">  <span class="built_in">printf</span>(<span class="string">&quot;\n&quot;</span>);</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">/*集合并集运算*/</span></span><br><span class="line"><span class="type">void</span> <span class="title function_">merge</span><span class="params">(SeqList A,SeqList B,SeqList *C)</span></span><br><span class="line">&#123;  <span class="type">int</span> i=<span class="number">0</span>,j=<span class="number">0</span>,k=<span class="number">0</span>;</span><br><span class="line">  <span class="keyword">while</span>(i&lt;=A.last&amp;&amp;j&lt;=B.last)</span><br><span class="line">  &#123; </span><br><span class="line">     <span class="keyword">if</span>(A.data[i]&lt;B.data[j])</span><br><span class="line">    &#123; <span class="comment">/* 把A中当前元素加入到结果集合C中*/</span></span><br><span class="line">      C-&gt;data[k]=A.data[i];</span><br><span class="line">      i++;</span><br><span class="line">      k++;</span><br><span class="line">     &#125;</span><br><span class="line">      <span class="keyword">else</span> <span class="keyword">if</span>(A.data[i]==B.data[j])</span><br><span class="line">       &#123; <span class="comment">/* 把A中当前元素加入到C集合中，丢掉B集合中当前元素*/</span></span><br><span class="line">        C-&gt;data[k]=A.data[i];</span><br><span class="line">        i++;</span><br><span class="line">        j++;</span><br><span class="line">        k++;</span><br><span class="line">      &#125;  </span><br><span class="line">     <span class="keyword">else</span> </span><br><span class="line">        &#123; <span class="comment">/* 把B中当前元素加入到C集合中*/</span></span><br><span class="line">        C-&gt;data[k]=B.data[j];</span><br><span class="line">        j++;</span><br><span class="line">        k++;</span><br><span class="line">     &#125;</span><br><span class="line">  &#125;</span><br><span class="line"><span class="comment">/*如果A集合中还有剩余元素*/</span></span><br><span class="line"> <span class="keyword">while</span>(i&lt;=A.last)</span><br><span class="line"> &#123; </span><br><span class="line">  C-&gt;data[k]=A.data[i];</span><br><span class="line">  i++;</span><br><span class="line">  k++;</span><br><span class="line">  &#125;</span><br><span class="line"><span class="comment">/*如果B集合中还有剩余元素*/</span></span><br><span class="line"> <span class="keyword">while</span>(j&lt;=B.last)</span><br><span class="line"> &#123; </span><br><span class="line">  C-&gt;data[k]=B.data[j];</span><br><span class="line">  j++;</span><br><span class="line">  k++;</span><br><span class="line"> &#125;</span><br><span class="line">C-&gt;last=k<span class="number">-1</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">/*集合交集运算*/</span></span><br><span class="line"><span class="type">void</span>  <span class="title function_">intersection</span><span class="params">(SeqList A,SeqList B,SeqList *C)</span></span><br><span class="line">&#123; <span class="type">int</span> i=<span class="number">0</span>,j=<span class="number">0</span>,k=<span class="number">0</span>;</span><br><span class="line">  <span class="keyword">while</span>(i&lt;=A.last&amp;&amp;j&lt;=B.last)</span><br><span class="line">  &#123; </span><br><span class="line">     <span class="keyword">if</span>(A.data[i]&lt;B.data[j])</span><br><span class="line">       &#123; <span class="comment">/*丢掉A中当前元素*/</span></span><br><span class="line">      i++;</span><br><span class="line">     &#125;</span><br><span class="line">     <span class="keyword">else</span> <span class="keyword">if</span>(A.data[i]==B.data[j])</span><br><span class="line">     &#123;  <span class="comment">/* 把A中当前元素加入到结果集合中，丢掉B集合中当前元素*/</span></span><br><span class="line">        C-&gt;data[k]=A.data[i];</span><br><span class="line">        i++;</span><br><span class="line">        j++;</span><br><span class="line">        k++;</span><br><span class="line">     &#125;</span><br><span class="line">     <span class="keyword">else</span>   &#123; <span class="comment">/*丢掉B中当前元素*/</span></span><br><span class="line">      j++;</span><br><span class="line">     &#125;</span><br><span class="line">  &#125;</span><br><span class="line"> C-&gt;last=k<span class="number">-1</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">/*集合差集运算*/</span></span><br><span class="line"><span class="type">void</span> <span class="title function_">difference</span><span class="params">(SeqList A,SeqList B,SeqList *C)</span></span><br><span class="line">&#123; <span class="type">int</span> i=<span class="number">0</span>,j=<span class="number">0</span>,k=<span class="number">0</span>;</span><br><span class="line">  <span class="keyword">while</span>(i&lt;=A.last&amp;&amp;j&lt;B.last)</span><br><span class="line">  &#123; </span><br><span class="line">     <span class="keyword">if</span>(A.data[i]&lt;B.data[j])</span><br><span class="line">       &#123; <span class="comment">/* 把A中当前元素加入到C集合中*/</span></span><br><span class="line">      C-&gt;data[k]=A.data[i];</span><br><span class="line">      i++;</span><br><span class="line">      k++;</span><br><span class="line">     &#125;</span><br><span class="line"></span><br><span class="line">     <span class="keyword">else</span> <span class="keyword">if</span>(A.data[i]==B.data[j])</span><br><span class="line">     &#123;  <span class="comment">/*丢掉A中当前元素*/</span></span><br><span class="line">      i++;</span><br><span class="line"><span class="comment">/*丢掉B中当前元素*/</span></span><br><span class="line">      j++;</span><br><span class="line"></span><br><span class="line">     &#125;</span><br><span class="line">     <span class="keyword">else</span>  &#123; <span class="comment">/*丢掉B中当前元素*/</span></span><br><span class="line">      j++;</span><br><span class="line">     &#125;</span><br><span class="line"></span><br><span class="line">  &#125;</span><br><span class="line"><span class="comment">/*如果A集合中还有剩余元素，把剩余元素放到结果集合中*/</span></span><br><span class="line"> <span class="keyword">while</span>(i&lt;=A.last)</span><br><span class="line"> &#123; </span><br><span class="line">  C-&gt;data[k]=A.data[i];</span><br><span class="line">  i++;</span><br><span class="line">  k++;</span><br><span class="line">  &#125;</span><br><span class="line">C-&gt;last=k<span class="number">-1</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></div>

<p>这是我根据你的要求完成的代码。如果你觉得有什么不对或不满意的地方，可以告诉我，我会尽力改进。😊</p>

        </div>

        

        
            <ul class="post-tags-box">
                
                    <li class="tag-item">
                        <a href="/tags/%E7%BB%8F%E9%AA%8C%E8%AE%B0%E5%BD%95/">#经验记录</a>&nbsp;
                    </li>
                
            </ul>
        

        

        
            <div class="article-nav">
                
                
                    <div class="article-next">
                        <a class="next"
                        rel="next"
                        href="/2023/09/23/Python%E5%9F%BA%E7%A1%80/"
                        >
                            <span class="title flex justify-center items-center">
                                <span class="post-nav-title-item">Python基础</span>
                                <span class="post-nav-item">下一篇</span>
                            </span>
                            <span class="right arrow-icon flex justify-center items-center">
                                <i class="fa-solid fa-chevron-right"></i>
                            </span>
                        </a>
                    </div>
                
            </div>
        


        
    </div>

    
        <div class="toc-content-container">
            <div class="post-toc-wrap">
    <div class="post-toc">
        <div class="toc-title">此页目录</div>
        <div class="page-title">EXCEL技巧记录</div>
        <ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#excel%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86%E6%8A%80%E5%B7%A7%EF%BC%9A"><span class="nav-text">excel数据处理技巧：</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%8F%90%E5%8F%96%E6%96%87%E4%BB%B6%E5%90%8D%E7%9A%84%E6%96%B9%E6%B3%95"><span class="nav-text">提取文件名的方法</span></a></li></ol></li></ol>

    </div>
</div>
        </div>
    
</div>



                

            </div>

            

        </div>

        <div class="main-content-footer">
            <footer class="footer mt-5 py-5 h-auto text-base text-third-text-color relative border-t-2 border-t-border-color">
    <div class="info-container py-3 text-center">
        
            <div class="customize-info my-1">死亡是涅灭,抑或是永恒?</div>
        
        <div class="text-center">
            &copy;
            
              <span>2023</span>
              -
            
            2023&nbsp;&nbsp;<i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i>&nbsp;&nbsp;<a href="/">雲之残骸</a>
        </div>
        
        <div class="relative text-center lg:absolute lg:left-[20px] lg:top-1/2 lg:-translate-y-1/2 lg:text-left">
            <span class="lg:block text-sm">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="relative top-[2px] inline-block align-baseline" version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" class="text-base" href="https://hexo.io">Hexo</a> 驱动</span>
            <span class="text-sm lg:block">主题&nbsp;<a class="text-base" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.4.4</a></span>
        </div>
        
        
            <div>
                博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
            </div>
        
        
            <script data-swup-reload-script>
                try {
                    function odometer_init() {
                    const elements = document.querySelectorAll('.odometer');
                    elements.forEach(el => {
                        new Odometer({
                            el,
                            format: '( ddd).dd',
                            duration: 200
                        });
                    });
                    }
                    odometer_init();
                } catch (error) {}
            </script>
        
        
        
    </div>  
</footer>
        </div>
    </div>

    
        <div class="post-tools">
            <div class="post-tools-container">
    <ul class="article-tools-list">
        <!-- TOC aside toggle -->
        
            <li class="right-bottom-tools page-aside-toggle">
                <i class="fa-regular fa-outdent"></i>
            </li>
        

        <!-- go comment -->
        
    </ul>
</div>

        </div>
    

    <div class="right-side-tools-container">
        <div class="side-tools-container">
    <ul class="hidden-tools-list">
        <li class="right-bottom-tools tool-font-adjust-plus flex justify-center items-center">
            <i class="fa-regular fa-magnifying-glass-plus"></i>
        </li>

        <li class="right-bottom-tools tool-font-adjust-minus flex justify-center items-center">
            <i class="fa-regular fa-magnifying-glass-minus"></i>
        </li>

        <li class="right-bottom-tools tool-expand-width flex justify-center items-center">
            <i class="fa-regular fa-expand"></i>
        </li>

        <li class="right-bottom-tools tool-dark-light-toggle flex justify-center items-center">
            <i class="fa-regular fa-moon"></i>
        </li>

        <!-- rss -->
        

        

        <li class="right-bottom-tools tool-scroll-to-bottom flex justify-center items-center">
            <i class="fa-regular fa-arrow-down"></i>
        </li>
    </ul>

    <ul class="visible-tools-list">
        <li class="right-bottom-tools toggle-tools-list flex justify-center items-center">
            <i class="fa-regular fa-cog fa-spin"></i>
        </li>
        
            <li class="right-bottom-tools tool-scroll-to-top flex justify-center items-center">
                <i class="arrow-up fas fa-arrow-up"></i>
                <span class="percent"></span>
            </li>
        
        
    </ul>
</div>

    </div>

    <div class="image-viewer-container">
    <img src="">
</div>


    
        <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
          <span class="search-input-field-pre">
            <i class="fa-solid fa-keyboard"></i>
          </span>
            <div class="search-input-container">
                <input autocomplete="off"
                       autocorrect="off"
                       autocapitalize="off"
                       placeholder="搜索..."
                       spellcheck="false"
                       type="search"
                       class="search-input"
                >
            </div>
            <span class="popup-btn-close">
                <i class="fa-solid fa-times"></i>
            </span>
        </div>
        <div id="search-result">
            <div id="no-result">
                <i class="fa-solid fa-spinner fa-spin-pulse fa-5x fa-fw"></i>
            </div>
        </div>
    </div>
</div>

    

</main>


    
<script src="/js/libs/Swup.min.js"></script>

<script src="/js/libs/SwupSlideTheme.min.js"></script>

<script src="/js/libs/SwupScriptsPlugin.min.js"></script>

<script src="/js/libs/SwupProgressPlugin.min.js"></script>

<script src="/js/libs/SwupScrollPlugin.min.js"></script>

<script>
    const swup = new Swup({
        plugins: [
            new SwupScriptsPlugin({
                optin: true,
            }),
            new SwupProgressPlugin(),
            new SwupScrollPlugin({
                offset: 80,
            }),
            new SwupSlideTheme({
                mainElement: ".main-content-body",
            }),
        ],
        containers: ["#swup"],
    });

    swup.hooks.on("page:view", () => {
        Global.refresh();
    });

    // if (document.readyState === "complete") {
    //
    // } else {
    //     document.addEventListener("DOMContentLoaded", () => init());
    // }
</script>






<script src="/js/utils.js" type="module"></script>

<script src="/js/main.js" type="module"></script>

<script src="/js/layouts/navbarShrink.js" type="module"></script>

<script src="/js/tools/scrollTopBottom.js" type="module"></script>

<script src="/js/tools/lightDarkSwitch.js" type="module"></script>

<script src="/js/layouts/categoryList.js" type="module"></script>



    
<script src="/js/tools/localSearch.js"></script>






    
<script src="/js/layouts/lazyload.js"></script>




    
<script src="/js/tools/runtime.js"></script>

    
<script src="/js/libs/odometer.min.js"></script>

    
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">




  
<script src="/js/libs/Typed.min.js"></script>

  
<script src="/js/plugins/typed.js"></script>




    
<script src="/js/libs/mermaid.min.js"></script>

    
<script src="/js/plugins/mermaid.js"></script>




    
<script src="/js/libs/minimasonry.min.js"></script>

    
<script src="/js/plugins/masonry.js" type="module"></script>




<div class="post-scripts" data-swup-reload-script>
    
        
<script src="/js/libs/anime.min.js"></script>

        
<script src="/js/tools/tocToggle.js" type="module"></script>

<script src="/js/layouts/toc.js" type="module"></script>

<script src="/js/plugins/tabs.js" type="module"></script>

    
</div>


</body>
</html>
